<html>
<body>
<?php
//connection
	$con = mysql_connect("localhost","dev","homesurf");
	
   if (!$con)
   {
		   die('Could not connect: ' . mysql_error());
   }
   mysql_select_db("homesurf", $con);

   if ($result = mysql_query("SELECT * FROM listings"))
   {
		   echo "<br>Database query fetched<br>";
   }
   $city = $_GET['City'];
	mysql_query("INSERT INTO listings ( City) VALUES ('" . $city . "')");
//close conn
mysql_close($con);
?>
</body>
</html>